package com.avecsys.quotemanager.pojos;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * Represents the plain java object for Buyer Master A Buyer would represent a company. An association
 * with Master Company to be Maintained
 * 
 * @author pavkumar
 */

public class BuyerMasterPojo extends BasePojo implements Serializable
{

	private Long buyerId;

	private CompanyMasterPojo companyMasterPojo = new CompanyMasterPojo();

	private SupplierMasterPojo supplierMasterPojo = new SupplierMasterPojo();

	private String contactPerson;

	private Set<BuyerUsersPojo> buyerUsers = new HashSet<BuyerUsersPojo>(0);

	private Set<QuoteTransactionPojo> quoteTransactionPojoSet = new HashSet<QuoteTransactionPojo>(0);

	public Long getBuyerId()
	{
		return buyerId;
	}

	public Set<BuyerUsersPojo> getBuyerUsers()
	{
		return buyerUsers;
	}

	public CompanyMasterPojo getCompanyMasterPojo()
	{
		return companyMasterPojo;
	}

	public String getContactPerson()
	{
		return contactPerson;
	}

	@Override
	public String getPkColumnName()
	{
		return "buyerId";
	}

	/**
	 * @return the quoteTransactionPojoSet
	 */
	public Set<QuoteTransactionPojo> getQuoteTransactionPojoSet()
	{
		return quoteTransactionPojoSet;
	}

	public SupplierMasterPojo getSupplierMasterPojo()
	{
		return supplierMasterPojo;
	}

	@Override
	public boolean isPersisted()
	{

		if (buyerId == null || buyerId.intValue() == 0)
		{
			return false;
		}
		else
		{
			return true;
		}

	}

	public void setBuyerId(Long buyerId)
	{
		this.buyerId = buyerId;
	}

	public void setBuyerUsers(Set<BuyerUsersPojo> buyerUsers)
	{
		this.buyerUsers = buyerUsers;
	}

	public void setCompanyMasterPojo(CompanyMasterPojo companyMasterPojo)
	{
		this.companyMasterPojo = companyMasterPojo;
	}

	public void setContactPerson(String contactPerson)
	{
		this.contactPerson = contactPerson;
	}

	/**
	 * @param quoteTransactionPojoSet the quoteTransactionPojoSet to set
	 */
	public void setQuoteTransactionPojoSet(Set<QuoteTransactionPojo> quoteTransactionPojoSet)
	{
		this.quoteTransactionPojoSet = quoteTransactionPojoSet;
	}

	public void setSupplierMasterPojo(SupplierMasterPojo supplierMasterPojo)
	{
		this.supplierMasterPojo = supplierMasterPojo;
	}

}
